import {
	defineStore
} from 'pinia'
import {
	ref
} from 'vue'

const classifyStore = defineStore('classifyStore', () => {
	let classifyList = ref(uni.getStorageSync("classify") || [])
	let currentIndex = ref(uni.getStorageSync("currentIndex") || 1)
	let setClassifyList = (dataList) => {
		uni.setStorageSync('classify', dataList)
		classifyList.value = dataList
	}

	let setCurrentIndex = (index) => {
		currentIndex.value = index
		uni.setStorageSync('currentIndex', index)
	}
	return {
		classifyList,
		setClassifyList,
		currentIndex,
		setCurrentIndex
	}
})

export default classifyStore